smartbuck8 2.2.0
Loading...
Searching...
No Matches
Smart Buck 8 Click Driver

API for configuring and manipulating Smart Buck 8 Click driver. More...

Topics

 Smart Buck 8 Registers List
 List of registers of Smart Buck 8 Click driver.
 Smart Buck 8 Registers Settings
 Settings for registers of Smart Buck 8 Click driver.
 Smart Buck 8 MikroBUS Map
 MikroBUS pin mapping of Smart Buck 8 Click driver.

Functions

void smartbuck8_cfg_setup (smartbuck8_cfg_t *cfg)
 Smart Buck 8 configuration object setup function.
err_t smartbuck8_init (smartbuck8_t *ctx, smartbuck8_cfg_t *cfg)
 Smart Buck 8 initialization function.
err_t smartbuck8_default_cfg (smartbuck8_t *ctx)
 Smart Buck 8 default configuration function.
err_t smartbuck8_write_reg (smartbuck8_t *ctx, uint8_t reg, uint8_t data_in)
 Smart Buck 8 write register function.
err_t smartbuck8_read_reg (smartbuck8_t *ctx, uint8_t reg, uint8_t *data_out)
 Smart Buck 8 read register function.
void smartbuck8_enable_power (smartbuck8_t *ctx)
 Smart Buck 8 enable power function.
void smartbuck8_disable_power (smartbuck8_t *ctx)
 Smart Buck 8 disable power function.
void smartbuck8_enable_device (smartbuck8_t *ctx)
 Smart Buck 8 enable device function.
void smartbuck8_disable_device (smartbuck8_t *ctx)
 Smart Buck 8 disable device function.
uint8_t smartbuck8_get_pg_pin (smartbuck8_t *ctx)
 Smart Buck 8 get power-good pin function.
err_t smartbuck8_read_status (smartbuck8_t *ctx, uint8_t *status)
 Smart Buck 8 read status register function.
err_t smartbuck8_set_control (smartbuck8_t *ctx, uint8_t control)
 Smart Buck 8 set control register function.
err_t smartbuck8_set_vout (smartbuck8_t *ctx, uint16_t vout_mv)
 Smart Buck 8 set output voltage function.

Detailed Description

API for configuring and manipulating Smart Buck 8 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ smartbuck8_cfg_setup()

void smartbuck8_cfg_setup ( smartbuck8_cfg_t * cfg)

Smart Buck 8 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See smartbuck8_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ smartbuck8_default_cfg()

err_t smartbuck8_default_cfg ( smartbuck8_t * ctx)

Smart Buck 8 default configuration function.

This function executes a default configuration of Smart Buck 8 Click board.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ smartbuck8_disable_device()

void smartbuck8_disable_device ( smartbuck8_t * ctx)

Smart Buck 8 disable device function.

This function sets the EN pin to low logic level to disable the device.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ smartbuck8_disable_power()

void smartbuck8_disable_power ( smartbuck8_t * ctx)

Smart Buck 8 disable power function.

This function sets the PON pin to low logic level to disable the internal power supply.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ smartbuck8_enable_device()

void smartbuck8_enable_device ( smartbuck8_t * ctx)

Smart Buck 8 enable device function.

This function sets the EN pin to high logic level to enable the device.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ smartbuck8_enable_power()

void smartbuck8_enable_power ( smartbuck8_t * ctx)

Smart Buck 8 enable power function.

This function sets the PON pin to high logic level to enable the internal power supply.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ smartbuck8_get_pg_pin()

uint8_t smartbuck8_get_pg_pin ( smartbuck8_t * ctx)

Smart Buck 8 get power-good pin function.

This function reads the logic level of the PG (power-good) pin.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
Returns
PG pin logic state.
Note
None.

◆ smartbuck8_init()

err_t smartbuck8_init ( smartbuck8_t * ctx,
smartbuck8_cfg_t * cfg )

Smart Buck 8 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See smartbuck8_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ smartbuck8_read_reg()

err_t smartbuck8_read_reg ( smartbuck8_t * ctx,
uint8_t reg,
uint8_t * data_out )

Smart Buck 8 read register function.

This function reads a single byte from one of the readable Smart Buck 8 registers. Allowed registers are VOUT, CONTROL, and STATUS.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Pointer to memory where read data will be stored.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck8_read_status()

err_t smartbuck8_read_status ( smartbuck8_t * ctx,
uint8_t * status )

Smart Buck 8 read status register function.

This function reads the value of the STATUS register and returns it via output pointer.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
[out]status: Pointer to memory where status register value will be stored.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck8_set_control()

err_t smartbuck8_set_control ( smartbuck8_t * ctx,
uint8_t control )

Smart Buck 8 set control register function.

This function writes a control byte to the CONTROL register.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
[in]control: Control register byte.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck8_set_vout()

err_t smartbuck8_set_vout ( smartbuck8_t * ctx,
uint16_t vout_mv )

Smart Buck 8 set output voltage function.

This function sets the output voltage by writing a scaled value to the VOUT register. Voltage range is [SMARTBUCK8_VOUT_MV_MIN, SMARTBUCK8_VOUT_MV_MAX] in steps of 5 mV.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
[in]vout_mv: Desired output voltage in millivolts.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck8_write_reg()

err_t smartbuck8_write_reg ( smartbuck8_t * ctx,
uint8_t reg,
uint8_t data_in )

Smart Buck 8 write register function.

This function writes a single byte to one of the writable Smart Buck 8 registers. Allowed registers are VOUT and CONTROL.

Parameters
[in]ctx: Click context object. See smartbuck8_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data byte to be written.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.